﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Compilex.BaseLibrary
{
    public class ThrowHelper
    {
        public static void ThrowIfNull<T>(T obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException();
            }
        }

        public static void ThrowIfNullOrEmpty(String arg)
        {
            if (arg == null || arg.Length == 0)
            {
                throw new ArgumentException();
            }
        }

        public static void ThrowIfFalse(bool value, string message)
        {
            if(!value)
                throw new ArgumentException(message);
        }
    }
}
